#ifndef __EXTI_CONFIG_H__
#define __EXTI_CONFIG_H__


#define USE_EXTI0			0
#define USE_EXTI1			0
#define USE_EXTI2			0
#define USE_EXTI3			0
#define USE_EXTI4			0
#define USE_EXTI5			0
#define USE_EXTI6			0
#define USE_EXTI7			0
#define USE_EXTI8			1
#define USE_EXTI9			0
#define USE_EXTI10		0
#define USE_EXTI11		1
#define USE_EXTI12		0
#define USE_EXTI13		1
#define USE_EXTI14		0
#define USE_EXTI15		1

// ---------------------------------------------
#if USE_EXTI0

#define EXTI0_SOFT	0

#if !EXTI0_SOFT

// GPIO
#define EXTI0_RCU					RCU_GPIOC
#define EXTI0_GPIO				GPIOC
#define EXTI0_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI0_SOUCE_PORT	EXTI_SOURCE_GPIOC
#define EXTI0_TRIG_TYPE		EXTI_TRIG_FALLING

#endif

#define EXTI0_IRQ_PRI		1, 0

#endif
// ---------------------------------------------

#if USE_EXTI1

#define EXTI1_SOFT	0

#if !EXTI1_SOFT

// GPIO
#define EXTI1_RCU					RCU_GPIOC
#define EXTI1_GPIO				GPIOC
#define EXTI1_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI1_SOUCE_PORT	EXTI_SOURCE_GPIOC
#define EXTI1_TRIG_TYPE		EXTI_TRIG_FALLING

#endif

#define EXTI1_IRQ_PRI		2, 0

#endif

// ---------------------------------------------
#if USE_EXTI2

#define EXTI2_SOFT	0

#if !EXTI2_SOFT

// GPIO
#define EXTI2_RCU					RCU_GPIOC
#define EXTI2_GPIO				GPIOC
#define EXTI2_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI2_SOUCE_PORT	EXTI_SOURCE_GPIOC
#define EXTI2_TRIG_TYPE		EXTI_TRIG_FALLING

#endif
#define EXTI2_IRQ_PRI		3, 0

#endif

// ---------------------------------------------
#if USE_EXTI5

#define EXTI5_SOFT	1

#if !EXTI5_SOFT

// GPIO
#define EXTI5_RCU					RCU_GPIOC
#define EXTI5_GPIO				GPIOC
#define EXTI5_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI5_SOUCE_PORT	EXTI_SOURCE_GPIOC
#define EXTI5_TRIG_TYPE		EXTI_TRIG_FALLING

#endif
#define EXTI5_IRQ_PRI		1, 0 //比串口高点

#endif

/*--------------------开启PB8(触摸按键)--------------------  */
#if USE_EXTI8

#define EXTI8_SOFT	0

#if !EXTI8_SOFT

// GPIO
#define EXTI8_RCU				RCU_GPIOB
#define EXTI8_GPIO				GPIOB
#define EXTI8_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI8_SOUCE_PORT	EXTI_SOURCE_GPIOB
#define EXTI8_TRIG_TYPE	EXTI_TRIG_BOTH

#endif
#define EXTI8_IRQ_PRI		2, 2

#endif
/*--------------------开启PD11 PD13 PD15的外部中断--------------------  */
#if USE_EXTI11

#define EXTI11_SOFT	0

#if !EXTI11_SOFT

// GPIO
#define EXTI11_RCU				RCU_GPIOD
#define EXTI11_GPIO				GPIOD
#define EXTI11_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI11_SOUCE_PORT	EXTI_SOURCE_GPIOD
#define EXTI11_TRIG_TYPE	EXTI_TRIG_BOTH

#endif
#define EXTI11_IRQ_PRI		2, 2

#endif

// ---------------------------------------------
#if USE_EXTI13

#define EXTI13_SOFT	0

#if !EXTI13_SOFT

// GPIO
#define EXTI13_RCU				RCU_GPIOD
#define EXTI13_GPIO				GPIOD
#define EXTI13_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI13_SOUCE_PORT	EXTI_SOURCE_GPIOD
#define EXTI13_TRIG_TYPE	EXTI_TRIG_BOTH

#endif
#define EXTI13_IRQ_PRI		2, 2

#endif
// ---------------------------------------------
#if USE_EXTI15

#define EXTI15_SOFT	0

#if !EXTI15_SOFT

// GPIO
#define EXTI15_RCU				RCU_GPIOD
#define EXTI15_GPIO				GPIOD
#define EXTI15_PUPD				GPIO_PUPD_PULLUP
// EXTI & NVIC
#define EXTI15_SOUCE_PORT	EXTI_SOURCE_GPIOD
#define EXTI15_TRIG_TYPE	EXTI_TRIG_BOTH

#endif
#define EXTI15_IRQ_PRI		2, 2

#endif

#endif